﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CardGamesLibrary.Tables;

namespace CardGamesLibrary.Poker
{
    public class PokerSeat : TableSeat
    {
        private readonly PokerTable _table;

        public PokerSeat(Player player, PokerTable table) : base(player)
        {
            _table = table;
           
        }

      

        public PokerSeat(PokerTable table)
        {
            _table = table;
        }

        private int _chips;
        public int Chips
        {
            get { return _chips; }
            set
            {
                if(_chips != value)
                {
                    NotifyPropertyChanged("Chips");
                    _chips = value;
                    
                }

                
            }
        }

        internal void CollectBet()
        {
            if (Chips > _table.BigBlind)
            {
                Chips -= _table.BigBlind;
                _table.CurrentPot += _table.BigBlind;
            }
            else if( Chips > 0) {
                var allin = Chips;
                Chips -= allin;
                _table.CurrentPot += allin;
            }
        }
    }
}
